import request from '@/utils/request'

// 查询设备维修单列表
export function listEquipmentRepair(query) {
  return request({
    url: '/device/equipmentRepair/list',
    method: 'get',
    params: query,
  })
}

// 查询设备维修单详细
export function getEquipmentRepair(wxmId) {
  return request({
    url: '/device/equipmentRepair/' + wxmId,
    method: 'get',
  })
}
// 查询设备单 子项数据
export function getWxdDet(wxmDjbh) {
  return request({
    url: '/device/equipmentRepair/getWxdDet/' + wxmDjbh,
    method: 'get',
  })
}

// 新增设备维修单
export function addEquipmentRepair(data) {
  return request({
    url: '/device/equipmentRepair',
    method: 'post',
    data: data,
  })
}

// 修改设备维修单
export function updateEquipmentRepair(data) {
  return request({
    url: '/device/equipmentRepair',
    method: 'put',
    data: data,
  })
}

// 删除设备维修单
export function delEquipmentRepair(wxmId) {
  return request({
    url: '/device/equipmentRepair/' + wxmId,
    method: 'delete',
  })
}
// 提交
export function submitEquipmentRepair(wxmId) {
  return request({
    url: '/device/equipmentRepair/submit/' + wxmId,
    method: 'post',
  })
}
// 添加-Wxd
export function addWxd(data) {
  return request({
    url: '/device/equipmentRepair/addWxd',
    method: 'post',
    data: data,
  })
}
// 删除-Wxd
export function delWxd(wxdId) {
  return request({
    url: '/device/equipmentRepair/delWxd/' + wxdId,
    method: 'delete',
  })
}
// 审核-Wxm
export function checkWxm(wxmId) {
  return request({
    url: '/device/equipmentRepair/checkWxm/' + wxmId,
    method: 'put',
  })
}
// 维修作业-撤回-Wxm
export function backCheckWxm(wxmId, reason) {
  return request({
    url: '/device/equipmentRepair/backCheckWxm/' + wxmId + '/' + reason,
    method: 'put',
  })
}
// 验收作业-验收
export function acceptWxm(wxmId, suggestion) {
  return request({
    url: '/device/equipmentRepair/acceptWxm/' + wxmId + '/' + suggestion,
    method: 'put',
  })
}
// 验收作业-撤回-Wxm
export function backAccpetWxm(wxmId, reason) {
  return request({
    url: '/device/equipmentRepair/backAccpetWxm/' + wxmId + '/' + reason,
    method: 'put',
  })
}

// 设备维修单-申请作业导出
export function exportModelRepair(query) {
  return request({
    url: '/device/equipmentRepair/export',
    method: 'get',
    params: query,
  })
}
